package froxy.urlfetch;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;

public class DirectGetUrlFetch extends DirectFetch {
    private static Log logger = LogFactory.getLog(DirectGetUrlFetch.class);

    @Override
    protected HttpUriRequest createRequest(HttpServletRequest request) {
	String askedURL = request.getRequestURL().toString();
	askedURL = addQueryString(request, askedURL);
	logger.info(request.getRemoteAddr() + " gets " + askedURL);
        askedURL = base64URL(askedURL);
        return new HttpGet(askedURL);
    }
}
